package com.mrper.ext.property;

import android.annotation.SuppressLint;
import android.databinding.BindingAdapter;
import android.graphics.Paint;
import android.widget.TextView;

/**
 * Created by admin on 2016/3/10.
 * TextView扩展XML属性
 */
public class TextViewExt {

    /**
     * 设置删除线
     * @param txtView
     * @param delLine 是否显示删除线
     */
    @SuppressWarnings("all")
    @SuppressLint("all")
    @BindingAdapter({"bind:delLine"})
    public static void setDelLine(TextView txtView, boolean delLine){
        if(delLine) txtView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
    }

}
